package zl.ioc_and_factory;
/**
 * @author  SuperZL 
 * @version 2012-8-29 下午3:39:22
 * 动物工厂类、用来生成动物对象
 */
public class AnimalFactory1 {
	
	public static Animal createAnimal(String name){
		Animal animal = null;
		if(null == name)
			return animal;
		else if(name.equalsIgnoreCase("Dog"))
			animal = new Dog();
		else if(name.equalsIgnoreCase("Person"))
			animal = new Person();
		return animal;
	}
}
